package com.winway.sixbook.ui;

import com.winway.sixbook.R;
import com.winway.sixbook.service.RecordDataManager;
import android.os.Bundle;
import android.app.Activity;
import android.database.Cursor;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;

public class TodayListActivity extends Activity {
	
	private static final String TAG = "TodayListActivity";
	ListView listView = null;
	private RecordDataManager mRecordDataManager;
	private TextView todaylist_textview_typename =null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.todaylistactivity);
		
		listView = (ListView)findViewById(R.id.newslist);
		if (mRecordDataManager == null) {
			mRecordDataManager = new RecordDataManager(this);
			mRecordDataManager.openDataBase();
        }
		Cursor cursor = mRecordDataManager.fetchAllRecordDatas();
        startManagingCursor(cursor);
         
        ListAdapter listAdapter = new SimpleCursorAdapter(this, R.layout.newslist_item, 
                cursor,
                new String[]{"content","type_name","add_time"}, 
				new int[]{R.id.newslist_item_digest,R.id.newslist_item_typename,R.id.newslist_item_ptime});
         
        listView.setAdapter(listAdapter);
        
        
       	}

}
